﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JTicket.Printer
{
    public class CardBusiness
    {

        /// <summary>
        /// 读卡器获取卡号
        /// </summary>
        public static string GetCadID()
        {
            string st;
            int CadID = 0x00;
            short CadType = 0x00;
            byte[] CadData = new byte[16];
            byte[] Data = new byte[16];
            if (c500USB.RC500USB_init().ToString() == "0")
                c500USB.RC500USB_request(0x01, ref CadType);
            st = c500USB.RC500USB_anticoll(0x00, ref CadID).ToString();
            c500USB.RC500USB_buzzer(1, 25, 25, 1);
            c500USB.RC500USB_config();
            if (st == "0" && CadID.ToString() != "0")
            {
                return c500USB.ToHight(CadID);
            }
            else
                return "系统未连接读卡器";
        }
    }
}
